package com.library.utils
{
	public class ColorUtil
	{
		public var red:uint;
		public var green:uint;
		public var blue:uint;
		
		public function ColorUtil()
		{
		}
		
		public static function randRGB():uint {
		 	return (Math.random() * 0xffffff + 0xff000000);
		}
		
		public static function RGBToHex(red:uint, green:uint, blue:uint):uint {
		 	var color:uint = red<<16|green<<8|blue;
		 	return color;
		}
		
		public static function HexToRGB(color:uint):ColorUtil {
		 	var r:uint = color>>16;
			var g:uint = color>>8&0xff;
			var b:uint = color&0xff;
			
			var colorObj:ColorUtil = new ColorUtil();
			colorObj.red = r;
			colorObj.green = g;
			colorObj.blue = b;
			
			return colorObj;
		}

	}
}